//
//  ZHReportContentView.swift
//  ZHWeibo
//
//  Created by user on 15/12/10.
//  Copyright © 2015年 heima. All rights reserved.
//

import UIKit
//let margin:CGFloat = 10.0
class ZHReportContentView: UIView {
    /// let margin:CGFloat = 10.0为什么这里声明了下面不能够使用
    //拥有模型属性,这里是存储属性,属性监视器不能是let
    var statusUserViewModel:ZHStatusUserViewModel? {
        didSet{
            contentLabel.text = statusUserViewModel?.userModel?.retweeted_status?.text
            
            if contentLabel.text != nil {
                printLog("1111")
            }
            
        }
    }
    
    
    //重写
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //设置UI
    private func setUpUI() {
        addSubview(contentLabel)
        //添加约束
        contentLabel.backgroundColor = UIColor.lightGrayColor()
        contentLabel.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(self).offset(margin)
            make.leading.equalTo(self).offset(margin)
            make.trailing.equalTo(self).offset(-margin)
        }
        snp_makeConstraints { (make) -> Void in
            make.bottom.equalTo(contentLabel).offset(margin)
        }
    }
    //懒加载控件
    private lazy var contentLabel = UILabel(textColor: UIColor.darkGrayColor(), textFont: 14, maxWidth: ScreenWith - margin * 2)
}
